package com.ruoyi.system.mapper;

import com.ruoyi.common.core.domain.entity.SysArea;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 地区Mapper接口
 *
 * @author shuyan
 * @date 2020-11-05
 */
public interface SysAreaMapper {

    List<SysArea> listAreasExactly(SysArea sysArea);

    int cleanAreaTable(String tableName);

    int batchInsert(@Param("mapList") List<Map<String, String>> mapList, @Param("tableName") String tableName);

    void initAfterInsert(@Param("tableName") String tableName);

    int syncFromStandard();

    int insertArea(SysArea area);

    int updateAreaName(SysArea area);

    int updateAreaWithAllChildren(SysArea area);

    int removeAreas(@Param("tableName") String tableName, @Param("code") String code);

    int childCount(@Param("tableName") String tableName, @Param("code") String code);

    List<SysArea> listByRootCodeAndLevel(@Param("tableName") String tableName, @Param("rootCode") String rootCode, @Param("level") Integer level);
}
